-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Snappi] Replacing dut.shell with dut.command for clearing counters in snappi clear_counter function #16272
Merged
yejianquan
merged 1 commit into
sonic-net:master
from
amitpawar12:issue-16270-clear-counters
Jan 16, 2025
Merged
[Snappi] Replacing dut.shell with dut.command for clearing counters in snappi clear_counter function #16272
yejianquan
merged 1 commit into
sonic-net:master
from
amitpawar12:issue-16270-clear-counters
Jan 16, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…clear_counters function
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
sdszhang
approved these changes
Jan 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Jan 16, 2025
…clear_counters function (sonic-net#16272) Description of PR The clear_counter function in tests/common/snappi_tests/common_helper.py used dut.shell to clear the sonic counters. However, the dut.shell inherently uses sudo, thus sonic clear counters in non-sudo mode were not getting cleared. Replacing dut.shell with dut.command to ensure that sonic-clear counters works in both SUDO and non-SUDO mode. Summary: Fixes sonic-net#16270 Approach What is the motivation for this PR? Replacing dut.shell with dut.command to clear the counters in both SUDO and non-SUDO mode. How did you do it? Replaced dut.shell with dut.command. How did you verify/test it? Local clone. AzDevOps@68684a43ec9e:/data/tests$ date;python3 -m pytest --inventory ../ansible/ixia-sonic --host-pattern ixre-egl-board71,ixre-egl-board72 --testbed ixre-chassis17-t2 --testbed_file ../ansible/testbed.csv --log-cli-level info --log-file-level info --kube_master unset --showlocals -ra --show-capture stdout --junit-xml=/tmp/test.xml --skip_sanity --log-file=/tmp/test.log --topology multidut-tgen --cache-clear --disable_loganalyzer snappi_tests/pfc/test_pfc_no_congestion_throughput.py -k test_multiple_prio_diff_dist snappi_tests/pfc/test_pfc_no_congestion_throughput.py::test_multiple_prio_diff_dist[multidut_port_info0-port_map0] 19:31:48 test_pfc_no_congestion_throughput.test_m L0096 INFO | Running test for testbed subtype: multi-dut-single-asic 19:31:51 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board71 with port Ethernet0 with IP 20.10.1.2/31 19:31:52 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board72 with port Ethernet0 with IP 20.10.1.0/31 19:31:53 test_pfc_no_congestion_throughput.test_m L0129 INFO | Selected lossless :[3, 4] and lossy priorities:[0, 2, 1] for the test 19:31:53 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board71 19:31:56 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board72 19:33:23 traffic_generation.run_traffic_and_colle L1026 INFO | Clearing PFC, dropcounters, queuecounters and stats PASSED [ 33%] snappi_tests/pfc/test_pfc_no_congestion_throughput.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 19:40:41 test_pfc_no_congestion_throughput.test_m L0096 INFO | Running test for testbed subtype: single-dut-multi-asic 19:40:44 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board71 with port Ethernet8 with IP 20.10.1.0/31 19:40:46 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board71 with port Ethernet152 with IP 20.10.1.2/31 19:40:47 test_pfc_no_congestion_throughput.test_m L0129 INFO | Selected lossless :[3, 4] and lossy priorities:[6, 1, 5] for the test 19:40:47 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board71 19:40:49 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board72 19:42:00 traffic_generation.run_traffic_and_colle L1026 INFO | Clearing PFC, dropcounters, queuecounters and stats PASSED [ 66%] snappi_tests/pfc/test_pfc_no_congestion_throughput.py::test_multiple_prio_diff_dist[multidut_port_info2-port_map0] 19:49:13 test_pfc_no_congestion_throughput.test_m L0096 INFO | Running test for testbed subtype: single-dut-single-asic 19:49:16 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board72 with port Ethernet8 with IP 20.10.1.0/31 19:49:18 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board72 with port Ethernet16 with IP 20.10.1.2/31 19:49:19 test_pfc_no_congestion_throughput.test_m L0129 INFO | Selected lossless :[3, 4] and lossy priorities:[2, 6, 0] for the test 19:49:19 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board71 19:49:21 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board72 19:50:32 traffic_generation.run_traffic_and_colle L1026 INFO | Clearing PFC, dropcounters, queuecounters and stats PASSED co-authorized by: [email protected]
Cherry-pick PR to 202411: #16543 |
8 tasks
mssonicbld
pushed a commit
that referenced
this pull request
Jan 16, 2025
…clear_counters function (#16272) Description of PR The clear_counter function in tests/common/snappi_tests/common_helper.py used dut.shell to clear the sonic counters. However, the dut.shell inherently uses sudo, thus sonic clear counters in non-sudo mode were not getting cleared. Replacing dut.shell with dut.command to ensure that sonic-clear counters works in both SUDO and non-SUDO mode. Summary: Fixes #16270 Approach What is the motivation for this PR? Replacing dut.shell with dut.command to clear the counters in both SUDO and non-SUDO mode. How did you do it? Replaced dut.shell with dut.command. How did you verify/test it? Local clone. AzDevOps@68684a43ec9e:/data/tests$ date;python3 -m pytest --inventory ../ansible/ixia-sonic --host-pattern ixre-egl-board71,ixre-egl-board72 --testbed ixre-chassis17-t2 --testbed_file ../ansible/testbed.csv --log-cli-level info --log-file-level info --kube_master unset --showlocals -ra --show-capture stdout --junit-xml=/tmp/test.xml --skip_sanity --log-file=/tmp/test.log --topology multidut-tgen --cache-clear --disable_loganalyzer snappi_tests/pfc/test_pfc_no_congestion_throughput.py -k test_multiple_prio_diff_dist snappi_tests/pfc/test_pfc_no_congestion_throughput.py::test_multiple_prio_diff_dist[multidut_port_info0-port_map0] 19:31:48 test_pfc_no_congestion_throughput.test_m L0096 INFO | Running test for testbed subtype: multi-dut-single-asic 19:31:51 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board71 with port Ethernet0 with IP 20.10.1.2/31 19:31:52 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board72 with port Ethernet0 with IP 20.10.1.0/31 19:31:53 test_pfc_no_congestion_throughput.test_m L0129 INFO | Selected lossless :[3, 4] and lossy priorities:[0, 2, 1] for the test 19:31:53 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board71 19:31:56 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board72 19:33:23 traffic_generation.run_traffic_and_colle L1026 INFO | Clearing PFC, dropcounters, queuecounters and stats PASSED [ 33%] snappi_tests/pfc/test_pfc_no_congestion_throughput.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 19:40:41 test_pfc_no_congestion_throughput.test_m L0096 INFO | Running test for testbed subtype: single-dut-multi-asic 19:40:44 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board71 with port Ethernet8 with IP 20.10.1.0/31 19:40:46 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board71 with port Ethernet152 with IP 20.10.1.2/31 19:40:47 test_pfc_no_congestion_throughput.test_m L0129 INFO | Selected lossless :[3, 4] and lossy priorities:[6, 1, 5] for the test 19:40:47 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board71 19:40:49 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board72 19:42:00 traffic_generation.run_traffic_and_colle L1026 INFO | Clearing PFC, dropcounters, queuecounters and stats PASSED [ 66%] snappi_tests/pfc/test_pfc_no_congestion_throughput.py::test_multiple_prio_diff_dist[multidut_port_info2-port_map0] 19:49:13 test_pfc_no_congestion_throughput.test_m L0096 INFO | Running test for testbed subtype: single-dut-single-asic 19:49:16 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board72 with port Ethernet8 with IP 20.10.1.0/31 19:49:18 snappi_fixtures.__intf_config_multidut L0933 INFO | Configuring Dut: ixre-egl-board72 with port Ethernet16 with IP 20.10.1.2/31 19:49:19 test_pfc_no_congestion_throughput.test_m L0129 INFO | Selected lossless :[3, 4] and lossy priorities:[2, 6, 0] for the test 19:49:19 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board71 19:49:21 snappi_fixtures.clear_fabric_counters L1504 INFO | Clearing fabric counters for DUT:ixre-egl-board72 19:50:32 traffic_generation.run_traffic_and_colle L1026 INFO | Clearing PFC, dropcounters, queuecounters and stats PASSED co-authorized by: [email protected]
mssonicbld
added
Included in 202411 branch
and removed
Created PR to 202411 branch
labels
Jan 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of PR
The clear_counter function in tests/common/snappi_tests/common_helper.py used dut.shell to clear the sonic counters.
However, the dut.shell inherently uses sudo, thus sonic clear counters in non-sudo mode were not getting cleared.
Replacing dut.shell with dut.command to ensure that sonic-clear counters works in both SUDO and non-SUDO mode.
Summary:
Fixes #16270
Type of change
Back port request
Approach
What is the motivation for this PR?
Replacing dut.shell with dut.command to clear the counters in both SUDO and non-SUDO mode.
How did you do it?
Replaced dut.shell with dut.command.
How did you verify/test it?
Local clone.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation